<?php


include('db.php');



//print_r($_REQUEST);
 
$list = Db::table('products')->where(['user_id'=>$_REQUEST['id']])->order('id desc')->select();


foreach ($list as $k=>$v){
    
    $img = Db::table('uploads')->where(['id'=>$v['thumbnail_img']])->find();
    
    
    $list[$k]['images'] = '/public/'.$img['file_name'];
}


$data['error']  = 0;
$data['list']  = $list;



echo  json_encode($data);

?>